package com.bl.student.dao.model;

import com.bl.student.common.enums.DetailType;
import com.bl.student.dao.model.converter.DatetimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by yujingyi on 2018/3/21.
 */
@Entity
@Data
@Table(name = "ITEM_TAG")
@ApiModel(value = "ItemTagEntity", description = "各类目标签表")
@DynamicInsert
@DynamicUpdate
public class ItemTagEntity {
    @Id
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "非详情ID,列表中的对应类目的id")
    @Column(name = "item_id")
    private String itemId;

    @ApiModelProperty(value = "标签id")
    @Column(name = "tag_id")
    private String tagId;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "类目类型: STUDIO 画室")
    private DetailType type;

    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    @Convert(converter = DatetimeConverter.class)
    private Long createTime;

    @ApiModelProperty(value = "修改时间")
    @Column(name = "update_time")
    @Convert(converter = DatetimeConverter.class)
    private Long updateTime;
}
